<?php

$app->get('/events', 'findEvents');

function findEvents() {
	$app = \Slim\Slim::getInstance();
	$name = mysql_real_escape_string(urldecode($app->request()->get('name')));
	$federalState = mysql_real_escape_string(urldecode($app->request()->get('federalState')));

	if (!$name) 
		errorOut("INVALID_ARGUMENT", "Name must be defined!");
	
	$sqlQuery = createEventSelectWithName($name, $federalState);
	jsonOut(doGetListResult($sqlQuery));
}

?>